package cn.anquing.controller;

import cn.anquing.vo.Response;
import com.baomidou.mybatisplus.plugins.Page;
import org.codehaus.groovy.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;


import javax.servlet.http.HttpServletRequest;

/**
 * 这个基础类是单例类，要特别注意属性
 * 
 * @author wiki
 * 
 */
public class BaseController {

	@Autowired
    HttpServletRequest request;// 用@Autowired注入的request不会有单例的问题

	protected Logger logger = LoggerFactory.getLogger(this.getClass());

	protected Response failure(String message) {
		return new Response().failure(message);
	}

	protected Response failure() {
		return new Response().failure();
	}

	protected Response success(Object data) {
		return new Response().success(data);
	}

	protected Response success() {
		return new Response().success();
	}





}
